package com.zaofan.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zaofan.bean.VersionLog;
import com.zaofan.dao.VersionLogDao;

public class VersionLogService {
	private VersionLogDao versionLogDao = new VersionLogDao();

	public void delete(VersionLog versionLog) {
		versionLogDao.del(versionLog);
	}

	public void add(VersionLog versionLog) {
		versionLogDao.add(versionLog);
	}

	public void update(VersionLog versionLog) {
		versionLogDao.update(versionLog);
	}

	public List<VersionLog> findAll(Map<String, Object> params) {
		List<VersionLog> data = versionLogDao.findAll(params);
		if (data == null) {
			data = new ArrayList<>();
		}
		return data;
	}

	public Long count(Map<String, Object> params) {
		return versionLogDao.count(params);
	}

	public VersionLog findById(Integer id) {
		Map<String, Object> params = new HashMap<>();
		params.put("id", id);
		return versionLogDao.findOne(params);
	}

}
